package com.wnxy.admin.common.itin;

import com.google.common.hash.BloomFilter;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class InitKey2Bloom implements CommandLineRunner {
    private final BloomFilter<String> bloomFilter;
    public InitKey2Bloom(BloomFilter<String> bloomFilter) {
        this.bloomFilter = bloomFilter;
    }
    @Override
    public void run(String... args) throws Exception {
        //将KEY白名单，加入到布隆过滤器中
        String[] keys = {"token","order"};
        for (String key : keys) {
            bloomFilter.put(key);
        }
    }
}
